 package com.finiac.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Proxy;

 
@Entity
@Proxy(lazy=false)
@Table(name="partial_payment")
public class PartialPayment {
	private long id;
	private Student studentId;
	private Bill billId;
	private float amount;
	private int isActive;
	
	@Id
	@GeneratedValue
	@Column(name="id")
	public long getId() {
		return id;
	}
	public void setId(long id) {
		this.id = id;
	}
	@ManyToOne(fetch=FetchType.EAGER)
	@JoinColumn(name="student_id")
	public Student getStudentId() {
		return studentId;
	}
	public void setStudentId(Student studentId) {
		this.studentId = studentId;
	}
	@ManyToOne(fetch=FetchType.EAGER)
	@JoinColumn(name="bill_id")
	public Bill getBillId() {
		return billId;
	}
	public void setBillId(Bill billId) {
		this.billId = billId;
	}
	@Column(name="amount")
	public float getAmount() {
		return amount;
	}
	public void setAmount(float amount) {
		this.amount = amount;
	}
	@Column(name="is_active")
	public int getIsActive() {
		return isActive;
	}
	public void setIsActive(int isActive) {
		this.isActive = isActive;
	}
	public PartialPayment(Student studentId, Bill billId, float amount) {
		this.studentId = studentId;
		this.billId = billId;
		this.amount = amount;
		this.isActive=1;
	}
	
	public PartialPayment(){}
}